@extends('admin.main')
@section('content')
    <div class="admin-biaogelist">
        <div class="daohang">
            <ul>
                <li>
                    <button type="button" class="am-btn am-btn-default am-radius am-btn-xs"> 兑换记录管理</button>
                </li>
            </ul>
        </div>
        <div class="listbiaoti am-cf">
            <ul class="am-icon-flag on"> 栏目名称</ul>

            <dl class="am-icon-home" style="float: right;"> 当前位置： 首页 > <a href="#">兑换记录列表</a></dl>

        </div>

        <form class="am-form am-g">
            <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped">
                <thead>
                <tr class="am-success">
                    <th class="table-id">ID</th>
                    <th class="table-title">优惠券名称</th>
                    <th class="table-type">序列号</th>
                    <th class="table-author">兑换人</th>
                    <th class="table-date am-hide-sm-only">兑换码</th>
                    <th class="table-author">兑换时间</th>
                </tr>
                </thead>
                <tbody>
                @if(!empty($res['data']))
                    @foreach($res['data'] as $v)
                        <tr>
                            <td>{{$v['id']}}</td>
                            <td>{{$v['favname']}}</td>
                            <td>{{$v['id_no']}}</td>
                            <td class="am-hide-sm-only">{{$v['name']}}</td>
                            <td>{{$v['code']}}</td>
                            <td class="am-hide-sm-only">{{$v['created_at']}}</td>
                        </tr>
                     @endforeach
                     @else
                     <tr>
                         <td colspan="6" align="center">暂无数据</td>
                     </tr>
                @endif
                </tbody>
            </table>
            @if(!empty($res['data']))
            <ul class="am-pagination am-fr">
                @if(isset($res['prev_page_url']))
                <li><a href="$res['prev_page_url']">«</a></li>
                @endif
                @foreach($res['pageNoList'] as $v)
                    @if($res['current_page']==$v)
                        <li class="am-active"><a href="{{urlAdmin('favorable','getDuihuanList')}}?page={{$v}}@if(isset($_GET['type']))&type={{$_GET['type']}}@endif">{{$v}}</a></li>
                    @else
                        <li><a href="{{urlAdmin('favorable','getDuihuanList')}}?page={{$v}}@if(isset($_GET['type']))&type={{$_GET['type']}}@endif">{{$v}}</a></li>
                    @endif
                @endforeach
                    @if(isset($res['next_page_url']))
                        <li><a href="$res['next_page_url']">»</a></li>
                    @endif
            </ul>
            @endif
    @include('admin.footer')
@endsection
@section('js')
       <script type="text/javascript" src="/assets/js/amazeui.dialog.min.js"></script>
@endsection
@section('script')
    <script>
        AMUI.dialog.alert({ title: '错误提示', content: '你的家还好吧', onConfirm: function() { console.log('close'); } });
    </script>
@endsection